GBML manual / Constants

DISTORT_BULGE

A barrel: the sprite is full width in the middle and narrower toward the top and the bottom.

Works differently on Game Boy - The Game Boy narrows a picture by moving its two sprite pieces toward each other on the lines the look names, so the middle of the line is covered instead of squeezed; 16 pixels wide at most, one bent picture at a time.

Works differently on Game Boy Color - The Game Boy Color narrows a picture by moving its two sprite pieces toward each other on the lines the look names, so the middle of the line is covered instead of squeezed; 16 pixels wide at most, one bent picture at a time.

On other consoles this differs: see Side by side and How the consoles differ.

Syntax

DISTORT_BULGE: constant

<!-- GENERATED by tools/gbabel_looks.py from its LOOKS registry. Never edit this page: change the registry and re-run it. -->

Description

Names the barrel, for sprite_distort. The middle row of the sprite is drawn at its real size and the rows above and below are drawn smaller and smaller, so the sprite looks as if it were wrapped round a barrel. The same curve SPRITE_BULGE draws for draw_sprite_3d.

strength is how much narrower the narrowest row is than the sprite: 1 is about four fifths of its width, 2 about two thirds and 3 a little over half. No row is ever drawn wider than the sprite, so no row is cut off at the sides.

A real capture, four pictures of the same gold plank - straight, then drawn as a barrel at strength 1, strength 2 and strength 3 (its ends get narrower and rounder each time, the middle stays full width)A real capture, four pictures of the same gold plank - straight, then drawn as a barrel at strength 1, strength 2 and strength 3 (its ends get narrower and rounder each time, the middle stays full width)
A real capture, four pictures of the same gold plank - straight, then drawn as a barrel at strength 1, strength 2 and strength 3 (its ends get narrower and rounder each time, the middle stays full width)

The same picture four times: straight, then strength 1, 2 and 3 from left to right, each one standing still where the pattern had got to. Real pictures from a Game Boy Advance ROM.

This look also squeezes the picture from top to bottom a little, so the picture ends a few rows short: the rows at its top and bottom are cut away, and the stronger the strength, the more of them. (The hourglass and the jelly change only the width, and keep every row.)

It is made for sprites up to about 32 pixels tall. A taller sprite gets the same shape, held at its strongest 16 rows above and below the middle.

Example

sprite_distort(DISTORT_BULGE, 2, 0);

A sprite curved like a barrel. Call it once, for example in the object's Create event - it keeps going by itself until you call sprite_distort(DISTORT_NONE, 0, 0) or the object is destroyed.

See also: sprite_distortDISTORT_NONEDISTORT_PINCH